home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #1 / Amiga Plus CD - 2000 - No. 1.iso / Tools / Grafik / Paint / Perfectpaint / rexx / ellipse / Make_Star.rx < prev    next >
Encoding:
Text File  |  1999-12-03  |  880 b   |  62 lines

  1. /* Script Rexx
  2.     AnimPainting for Circle*/
  3.  
  4.     call addlib("rexxmathlib.library", 5, -30, 0)
  5.  
  6.     options results
  7.   parse ARG Port x1 y1 r r3 b
  8.     ADDRESS value Port
  9.  
  10.     pp_UpdateUndo
  11.  
  12.     r2=r/3
  13.     r4=r3/3
  14.     Pi=3.1415926/180
  15.  
  16.     pp_DialogInit 250 85 "*Star*" 2
  17.         pp_Integer 0 110 5 50 16 "Number*of*Point*" 1 3
  18.         pp_Cycle 1 110 25 100 16 "Option" 1 "Filled|Unfilled" 0
  19.     pp_Dialog
  20.     rc=result
  21.     if rc=0 then
  22.         do
  23.             EXIT
  24.         end        
  25.         
  26.     pp_GetDialog 0
  27.     s0=result
  28.  
  29.     pp_GetDialog 1
  30.     sens=result
  31.  
  32.     a=360/s0
  33.     a2=a/2
  34.  
  35.     pp_StartPoly
  36.  
  37.   DO i=0 To 359 by a
  38.  
  39.       x = Sin(i*Pi)*r+x1
  40.     y = Cos(i*Pi)*r3+y1
  41.         
  42.         ii=i+a2
  43.       x2 = Sin(ii*Pi)*r2+x1
  44.     y2 = Cos(ii*Pi)*r4+y1
  45.  
  46.         ii=i-a2
  47.       x3 = Sin(ii*Pi)*r2+x1
  48.     y3 = Cos(ii*Pi)*r4+y1
  49.         
  50.         pp_AddPoly trunc(x3) trunc(y3)
  51.         pp_AddPoly trunc(x) trunc(y)
  52.         pp_AddPoly trunc(x2) trunc(y2)        
  53.         
  54.     END
  55.  
  56.         IF sens=1 then DO
  57.             pp_EndPoly
  58.         END
  59.         ELSE DO
  60.             pp_EndPolyF
  61.         END
  62.